package com.wellink.progressbardemo2;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.SeekBar;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity implements SeekBar.OnSeekBarChangeListener {

    SeekBar seekBar;
    TextView promptTv,progressTv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.seekbar_layout);

        seekBar = findViewById(R.id.seekbar);
        progressTv = findViewById(R.id.pb_tv);
        promptTv = findViewById(R.id.promt_tv);

        seekBar.setOnSeekBarChangeListener(this);

    }

    @Override
    public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
        promptTv.setText("正在拖动");
        progressTv.setText("当前进度："+ progress);

    }

    @Override
    public void onStartTrackingTouch(SeekBar seekBar) {
        promptTv.setText("开始拖动");
    }

    @Override
    public void onStopTrackingTouch(SeekBar seekBar) {
        promptTv.setText("停止拖动");
    }
}
